<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditPrizeTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.EditPrizeLabel_prizeID}" for="prizeID" />
                    <h:inputText id="prizeID" value="#{prizeController.selected.prizeID}" title="#{bundle.EditPrizeTitle_prizeID}" required="true" requiredMessage="#{bundle.EditPrizeRequiredMessage_prizeID}"/>
                    <h:outputLabel value="#{bundle.EditPrizeLabel_prizeValue}" for="prizeValue" />
                    <h:inputText id="prizeValue" value="#{prizeController.selected.prizeValue}" title="#{bundle.EditPrizeTitle_prizeValue}" />
                    <h:outputLabel value="#{bundle.EditPrizeLabel_awarded}" for="awarded" />
                    <h:inputText id="awarded" value="#{prizeController.selected.awarded}" title="#{bundle.EditPrizeTitle_awarded}" />
                    <h:outputLabel value="#{bundle.EditPrizeLabel_awardDate}" for="awardDate" />
                    <h:inputText id="awardDate" value="#{prizeController.selected.awardDate}" title="#{bundle.EditPrizeTitle_awardDate}" >
                        <f:convertDateTime pattern="MM/dd/yyyy HH:mm:ss" />
                    </h:inputText>
                    <h:outputLabel value="#{bundle.EditPrizeLabel_studentID}" for="studentID" />
                    <h:selectOneMenu id="studentID" value="#{prizeController.selected.studentID}" title="#{bundle.EditPrizeTitle_studentID}" >
                        <f:selectItems value="#{studentController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditPrizeLabel_prizeCateID}" for="prizeCateID" />
                    <h:selectOneMenu id="prizeCateID" value="#{prizeController.selected.prizeCateID}" title="#{bundle.EditPrizeTitle_prizeCateID}" >
                        <f:selectItems value="#{prizeCategoryController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                    <h:outputLabel value="#{bundle.EditPrizeLabel_eventID}" for="eventID" />
                    <h:selectOneMenu id="eventID" value="#{prizeController.selected.eventID}" title="#{bundle.EditPrizeTitle_eventID}" >
                        <f:selectItems value="#{eventController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <h:commandLink action="#{prizeController.update}" value="#{bundle.EditPrizeSaveLink}"/>
                <br />
                <br />
                <h:commandLink action="View" value="#{bundle.EditPrizeViewLink}" immediate="true"/>
                <br />
                <h:commandLink action="#{prizeController.prepareList}" value="#{bundle.EditPrizeShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:commandLink value="#{bundle.EditPrizeIndexLink}" action="/index" immediate="true" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
